<style>
  .switch-wrap .el-form-item__content {
    height: 40px;
    display: flex;
    align-items: center;
  }
  /* .el-tree-node:focus > .el-tree-node__content {
    background-color: #ebeef5;
  }
  .is-checked .el-tree-node__content {
    background-color: #ebeef5;
  } */
</style>
<template>
  <div class="home overflowY">
    <div class="PageContent" v-loading="loading">
      <el-form
        :model="ruleForm"
        :inline="true"
        ref="homeRuleForm"
        :rules="rules"
        class="demo-ruleForm"
        :disabled="saveFlag"
        @submit.native.prevent
      >
        <div class="PageItem margintop20">
          JC202011120001
          202010310001
          <el-row class="paddingleft2em">
            <el-form-item label="寄存编号" style="margin-bottom: 0">
              <el-input
                v-model="ruleForm.businessCode"
                ref="homebusinessCode"
                @keyup.enter.native="searchData"
                :maxlength="20"
                placeholder="请输入业务编码"
              >
                <el-button
                  type="primary"
                  slot="append"
                  icon="el-icon-search"
                  @click="searchData"
                ></el-button>
              </el-input>
              <!-- <el-button type="primary" :disabled="saveFlag">扫描</el-button> -->
              <!-- <el-button type="primary" :disabled="saveFlag">选择</el-button> -->
            </el-form-item>
            <el-button
              type="success"
              icon="el-icon-plus"
              style="margin-left: 20px"
              @click="AddInfo()"
            >新增寄存
            </el-button
            >
          </el-row>
        </div>
        <div class="PageItem">
          <el-row class="PageInfo"><i class="info-bar"></i>寄存位置</el-row>
          <el-row class="paddingleft2em">
            <el-form-item label="寄存类型">
              <el-radio
                v-model="ruleForm.depositTypeCode"
                :label="1"
                @change="DepositType(ruleForm.depositTypeCode)"
              >长期寄存
              </el-radio
              >
              <el-radio
                v-model="ruleForm.depositTypeCode"
                :label="2"
                @change="DepositType(ruleForm.depositTypeCode)"
              >临时寄存
              </el-radio
              >
            </el-form-item>
            <el-form-item label="寄存位置" prop="positionName">
              <el-input
                readonly
                class="w425"
                placeholder="请填写寄存位置"
                v-model="ruleForm.positionName"
              ></el-input>
            </el-form-item>
            <el-button
              type="primary"
              :disabled="saveFlag"
              @click="dialogVisible = true"
            >选择寄存格位
            </el-button
            >
          </el-row>
          <el-row class="paddingleft2em">
            <el-form-item label="备注">
              <el-input
                class="w1230"
                placeholder="请填写备注"
                v-model="ruleForm.remark"
              ></el-input>
            </el-form-item>
          </el-row>
        </div>
        <div class="PageItem">
          <el-row class="PageInfo"><i class="info-bar"></i>寄存联系人</el-row>
          <el-row class="paddingleft2em">
            <el-form-item label="姓名" prop="familyName">
              <el-input
                minlength="2"
                maxlength="50"
                placeholder="请填写姓名"
                v-model="ruleForm.familyName"
              >
                <span
                  slot="append"
                  style="cursor: pointer"
                  @click="readDeadIdCard('familyMember')"
                >读取</span
                >
              </el-input>
            </el-form-item>
            <el-form-item label="证件类型">
              <el-select
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchcertificates"
                placeholder="请选择证件类型1"
                class="w150"
                v-model="ruleForm.certificateTypeCode"
              >
                <el-option
                  v-for="item in copydictionary.certificates"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="证件号码" prop="certificateNo">
              <el-input
                maxlength="20"
                placeholder="请填写证件号码"
                v-model="ruleForm.certificateNo"
              ></el-input>
            </el-form-item>
            <el-form-item label="性别">
              <el-select
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchsex"
                placeholder="性别"
                v-model="ruleForm.familyGenderCode"
              >
                <el-option
                  v-for="item in copydictionary.sex_simple"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="年龄">
              <el-input
                placeholder="请输入"
                :disabled="agetype == ageWeizhiFlag ? true : false"
                @input="agelimit(ruleForm.familyAge)"
                class="input-with-select"
                v-model="ruleForm.familyAge"
              >
                <el-select
                  v-model="agetype"
                  slot="prepend"
                  class="agewidth"
                  placeholder="请选择"
                  @change="age(agetype)"
                >
                  <el-option
                    v-for="item in copydictionary.age_type"
                    :key="item.dataCode"
                    :label="item.dataText"
                    :value="item.dataCode"
                    :disabled="item.disableState"
                  />
                </el-select>
              </el-input>
            </el-form-item>
          </el-row>
          <el-row class="paddingleft2em">
            <el-form-item label="联系电话" prop="familyPhone">
              <el-input
                v-model="ruleForm.familyPhone"
                onkeyup="value=value.replace(/[^\d]/g,'')"
                maxlength="11"
                placeholder="请填写联系电话"
              ></el-input>
            </el-form-item>
            <el-form-item label="　联系地址">
              <el-input
                class="w50"
                placeholder="请填写联系地址"
                v-model="ruleForm.familyAddress"
              ></el-input>
            </el-form-item>
          </el-row>
        </div>
        <div class="PageItem">
          <el-row class="PageInfo">
            <i class="info-bar"></i>寄存骨灰信息
            <el-button
              type="primary"
              :disabled="saveFlag"
              style="float: right"
              @click="
                ruleForm.depositDeadItems.push({
                  id: 0,
                  businessCode: '',
                  deadName: '',
                  deadGender: '',
                  deadAge: '',
                  familyRelation: '',
                  deadContent: '',
                  asHasAsh: false,
                  deadStorageTime: '',
                  certificateType: '',
                  certificateNo: '',
                  depositStateCode: '',
                  depositState: '',
                  version: '',
                })
              "
            >新增逝者骨灰
            </el-button
            >
          </el-row
          >
          <div v-for="(item, index) in ruleForm.depositDeadItems" :key="index">
            <el-row class="PageInfo">
              <el-form-item label="骨灰盒条码">
                <el-input
                  v-model="item.businessCode"
                  minlength="2"
                  maxlength="50"
                  placeholder="请填写骨灰盒条码"
                >
                  <span
                    slot="append"
                    style="cursor: pointer"
                    @click="search(index)"
                  >扫描</span
                  >
                </el-input>
                <el-button
                  type="primary"
                  style="float: right"
                  @click="ruleForm.depositDeadItems.splice(index, 1)"
                  :disabled="ruleForm.depositDeadItems.length <= 1"
                >删除
                </el-button
                >
              </el-form-item>
            </el-row
            >

            <el-row class="paddingleft2em">
              <el-form-item
                label="逝者姓名"
                :prop="`depositDeadItems[${index}].deadName`"
                :rules="{
                  required: true,
                  message: '请输入逝者姓名',
                  trigger: 'blur',
                }"
              >
                <el-input
                  v-model="item.deadName"
                  maxlength="20"
                  placeholder="请填写逝者姓名"
                ></el-input>
              </el-form-item>

              <el-form-item label="　证件类型">
                <el-select
                  @focus="focus"
                  @clear="clear"
                  clearable
                  filterable
                  :filter-method="PinyinMatchcertificates"
                  placeholder="请选择证件类型"
                  class="w150"
                  v-model="item.certificateTypeCode"
                  @change="Change"
                >
                  <el-option
                    v-for="item in copydictionary.certificates"
                    :key="item.dataCode"
                    :label="item.dataText"
                    :value="item.dataCode"
                    :disabled="item.disableState"
                  />
                </el-select>
              </el-form-item>
              <el-form-item
                label="　证件号码"
                :prop="`depositDeadItems[${index}].certificateNo`"
                :rules="{
                  pattern: /(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/,
                  message: '请输入正确的身份证号码',
                }"
              >
                <el-input
                  v-model="item.certificateNo"
                  maxlength="20"
                  placeholder="请填写证件号码"
                ></el-input>
              </el-form-item>
              <el-form-item label="　性别">
                <el-select
                  @focus="focus"
                  @clear="clear"
                  clearable
                  filterable
                  :filter-method="PinyinMatchsex"
                  placeholder="性别"
                  v-model="item.deadGenderCode"
                  @change="Change"
                >
                  <el-option
                    v-for="item in copydictionary.sex_simple"
                    :key="item.dataCode"
                    :label="item.dataText"
                    :value="item.dataCode"
                    :disabled="item.disableState"
                  />
                </el-select>
              </el-form-item>
              <el-form-item label="　年龄">
                <el-input
                  v-model="item.deadAge"
                  placeholder="请输入"
                  :disabled="agetype == ageWeizhiFlag ? true : false"
                  @input="agelimit(item.deadAge, index)"
                  class="input-with-select"
                >
                  <el-select
                    v-model="agetype"
                    slot="prepend"
                    class="agewidth"
                    placeholder="请选择"
                    @change="age(agetype)"
                  >
                    <el-option
                      v-for="item in copydictionary.age_type"
                      :key="item.dataCode"
                      :label="item.dataText"
                      :value="item.dataCode"
                      :disabled="item.disableState"
                    />
                  </el-select>
                </el-input>
              </el-form-item>
            </el-row>
            <el-row class="paddingleft2em">
              <el-form-item label="与家属关系" class="lineheight letter2">
                <el-select
                  v-model="item.familyRelation"
                  allow-create
                  @focus="focus"
                  @clear="clear"
                  clearable
                  filterable
                  :filter-method="PinyinMatchrelationship_with_deceased"
                  placeholder="请选择或输入"
                  class="w150"
                >
                  <el-option
                    v-for="item in copydictionary.relationship_with_deceased"
                    :key="item.dataCode"
                    :label="item.dataText"
                    :value="item.dataText"
                    :disabled="item.disableState"
                  />
                </el-select>
              </el-form-item>
              <el-form-item
                label="寄存内容"
                :prop="`depositDeadItems[${index}].deadContent`"
                :rules="{
                  required: true,
                  message: '请输入寄存内容',
                  trigger: 'blur',
                }"
              >
                <el-input
                  class="w425"
                  placeholder="请填写寄存内容"
                  v-model="item.deadContent"
                ></el-input>
              </el-form-item>

              <el-form-item
                label="存放日期"
                :prop="`depositDeadItems[${index}].deadStorageTime`"
                :rules="{
                  required: true,
                  message: '请输入存放日期',
                  trigger: 'blur',
                }"
              >
                <el-date-picker
                  v-model="item.deadStorageTime"
                  type="date"
                  placeholder="选择日期"
                  class="w150"
                ></el-date-picker>
              </el-form-item>
              <el-form-item label="盒内状况" class="switch-wrap">
                <!--                <el-switch-->
                <!--                  v-model="item.asHasAsh"-->
                <!--                  active-color="#13ce66"-->
                <!--                  active-text="有灰"-->
                <!--                  inactive-text="无灰"-->
                <!--                >-->
                <!--                </el-switch>-->
                <!--                {{item.asHasAsh}}-->
                <div class="">
                  <switchs v-model="item.asHasAsh" @switchChange="switchChange" :item="index" text="有灰|无灰"></switchs>
                </div>
              </el-form-item>
            </el-row>
          </div>
        </div>
        <div class="PageItem">
          <el-row class="PageInfo"><i class="info-bar"></i>寄存信息</el-row>
          <el-row class="paddingleft2em">
            <el-form-item label="寄存开始日期" label-width="120px">
              <el-date-picker
                v-model="ruleForm.startDate"
                type="date"
                placeholder="选择日期"
                class="w150"
                @change="Timechange(ruleForm.startDate)"
              ></el-date-picker>
            </el-form-item>

            <el-form-item label="单位" prop="renewUnit">
              <el-radio v-model="ruleForm.renewUnit" label="年">年</el-radio>
              <el-radio v-model="ruleForm.renewUnit" label="月">月</el-radio>
            </el-form-item>
            <el-form-item label="寄存数量" prop="renewNumber">
              <el-input
                v-model.number="ruleForm.renewNumber"
                maxlength="20"
                placeholder="请填写寄存数量"
                @blur="DepositQuantity(ruleForm.renewNumber)"
              ></el-input>
            </el-form-item>
            <el-form-item label="寄存结束日期" label-width="120px">
              <el-date-picker
                v-model="ruleForm.endDate"
                type="date"
                placeholder="选择日期"
                class="w150"
              ></el-date-picker>
            </el-form-item>
            <el-form-item label="寄存金额" prop="itemCharge">
              <el-input
                v-model="ruleForm.itemCharge"
                onkeyup="value=value.replace(/[^\d]/g,'')"
                maxlength="11"
                placeholder="请填写联系电话"
              ></el-input>
            </el-form-item>
          </el-row>
        </div>

        <DepositFee
          :tableData="this.tableData"
          :businessCode="this.ruleForm.businessCode"
          :dbid="this.ruleForm.dbId"
          @input="tableData = $event"
          :showList="chargeItems"
          :showListStatus="showListStatus"
        />

        <el-row
          class="PageItem"
          :gutter="30"
          style="text-align: right; margin: 30px 0"
        >
          <el-button type="primary" @click="Save()" :disabled="saveFlag"
          >保存
          </el-button
          >
          <el-button
            type="primary"
            @click="SaveAndService()"
            v-if="btnRight.btnSaveJumpServiceNegotiation"
            :disabled="saveFlag"
          >保存并进行服务洽谈
          </el-button
          >
          <el-button
            type="primary"
            plain
            @click="PhotoArchival()"
            v-if="btnRight.btnPhotoArchival && photoBtnlimt && !new_photolimit"
          >拍照备案
          </el-button
          >
        </el-row>
      </el-form>
      <StorageCellDialog
        :dialogVisible="dialogVisible"
        @update:dialogVisible="(e) => (dialogVisible = e)"
        @input="determine($event)"
      />
    </div>
    <div style="width: 0px; height: 0px; overflow: hidden">
      <object id="view1" type="application/x-eloamplugin" name="view"></object>
    </div>
    <div id="idCardContainer"></div>
  </div>
</template>

<script>
  import * as Type from "@/api/service";
  import {dataFormate, dataFormatetmd} from "@/utils/index";
  import StorageCellDialog from "@/views/dialog/StorageCellDialog";
  import DepositFee from "@/components/DepositInformationDisplay/DepositFee";
  // import {provinceCityCounty} from '@/utils/provinceCityCounty'
  // import GPY_S620A3XR from '@/api/GPY_S620A3XR'
  // import { getLodop } from "@/utils/lodopFuncs";

  import IdCard from "@/api/IdCard_SS628_100_001U";
  import {mapGetters} from "vuex";

  import switchs from '@/components/switch/switch';

  export default {
    name: "home",
    props: {
      //自定义模板清除属性
      clearable: {
        type: Boolean,
        default: true,
      },
    },
    components: {
      StorageCellDialog,
      DepositFee,
      switchs,
    },
    data() {
      const _self = this;
      return {
        dialogVisible: false, //格位弹框
        dialogTableVisible: false, //寄存费用弹框
        loading: false,
        businessCode: "", //寄存编号
        title: "",
        form: {
          //弹框表单
        },
        depositCasePrice: "",
        ruleForm: {
          businessCode: "",
          //寄存位置
          depositTypeCode: "", //寄存类型code
          depositType: "", //寄存类型
          positionName: "", //寄存位置
          remark: "", //备注
          depositCaseId: "", //寄存格位id
          //寄存联系人
          familyName: "",
          certificateType: "",
          certificateNo: "",
          familyGenderCode: "",
          familyAge: "",
          familyPhone: "",
          familyAddress: "",
          DepositLocation: {},
          DepositContact: {},
          //寄存骨灰信息

          depositDeadItems: [
            {
              id: 0,
              businessCode: "",
              deadName: "",
              deadGender: "",
              deadAge: "",
              familyRelation: "",
              deadContent: "",
              asHasAsh: false,
              deadStorageTime: "",
              certificateType: "",
              certificateNo: "",
              depositStateCode: "",
              depositState: "",
              version: "",
            },
          ],
          //寄存信息
          startDate: "",
          endDate: "",
          renewUnit: "",
          renewNumber: 0,
          itemCharge: 0,
        }, //按钮权限
        // copydictionary:{},
        btnRight: {
          btnBusinessCodeScanning: false,
          btnAddFuneralBusiness: false,
          btnReadDeadIdentityCard: false,
          btnReadFamilyMemberIdentityCard: false,
          btnReadFamilyAgentIdentityCard: false,
          btnSaveFuneralBusiness: false,
          btnSaveJumpServiceNegotiation: false,
          btnPhotoArchival: false,
          btnPrintQRCode: false,
        }, //业务编码

        rules: {
          familyName: [
            {required: true, message: "请输入姓名", trigger: "blur"},
            {
              min: 1,
              max: 20,
              message: "长度在 1 到 20 个字符",
              trigger: "blur",
            },
          ],
          certificateNo: [
            {required: true, message: "请输入证件号码", trigger: "blur"},
            {
              pattern: /(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/,
              message: "请输入正确的身份证号码",
            },
          ],
          familyPhone: [
            {required: true, message: "请输入联系电话", trigger: "blur"},
          ],
          deadName: [
            {required: true, message: "请输入逝者姓名", trigger: "blur"},
          ],
          renewUnit: [{required: true, message: "请输入单位", trigger: "blur"}],
          renewNumber: [
            {required: true, message: "请输入数量", trigger: "blur"},
          ],
          itemCharge: [
            {required: true, message: "请输入金额", trigger: "blur"},
          ],
          positionName: [
            {required: true, message: "请输入寄存位置", trigger: "change"},
          ],
        },
        dictionary: {}, //字典
        copydictionary: {}, //用于检索拼音
        // negotiator_user: [], //洽谈员单独读取
        // selectedOptions: [],
        modify: true, //新增时为true
        new_photolimit: false, //新增时为true
        // streetlist: [], //街道列表
        // villagelist: [], //村列表
        saveFlag: false, //保存过程中不可更改,true为正在保存
        //省市区县数据
        // options: [],
        // option: [],
        agetype: 1, //年龄类型
        ageWeizhiFlag: 0,

        photoBtnlimt: false, //初次保存前，“拍照备案”和“打印逝者二维码”按钮禁用
        onpresscTime: 0, //  阻止短时间内连续点击
        timeint: null,
        tableData: [],
        chargeItems: [],
        showListStatus: true,
      };
    },
    created() {
      // 读取路由传过来的参数,优先启用参数传过来的
      let code = this.$route.params.businessCodeParam;
      if (code != null) {
        this.ruleForm.businessCode = code;
        this.ReadData();
      } else if (this.$store.getters.businessCode) {
        this.ruleForm.businessCode = this.$store.getters.businessCode;
        this.ReadData();
      }
    },
    mounted() {
      //按钮权限
      this.btnRight = this.$route.meta.buttons;
      //遍历属性赋值将true与false字符串转换成布尔型的值
      for (var key of Object.keys(this.btnRight)) {
        this.btnRight[key] =
          this.btnRight[key] || this.btnRight[key] == "true" ? true : false;
      }
      //加载洽谈员
      // this.loaduserwithtypecode();
      // 初始化高拍仪设备
      //GPY_S620A3XR.camera.load();
      //加载数据字典
      //没有数据，加载数据
      this.$store
        .dispatch("user/getdictionary")
        .then((res) => {
          //获取字典数据
          this.dictionary = res;
          this.copydictionary = JSON.parse(JSON.stringify(this.dictionary));
          this.$set(this.dictionary, res);
          //获取未知的code
          if (
            this.copydictionary.age_type &&
            this.copydictionary.age_type.length
          ) {
            this.copydictionary.age_type.forEach((item) => {
              if (item.dataText == "未知") {
                this.ageWeizhiFlag = item.dataCode;
              }
            });
          }
        })
        .catch(() => console.log("promise catch err"));
    },
    computed: {
      //计算
    },

    methods: {
      // -------弹框相关函数------------------
      determine(e) {
        this.ruleForm.positionName = e.positionName; //寄存位置
        this.ruleForm.depositCaseId = e.id; //格位id
        this.depositCasePrice = e.depositCasePrice;

        if (!!e.businessCode) {
          this.ruleForm.businessCode = e.businessCode;
          this.ReadData();
        } else {
          this.AddInfo();
          this.ruleForm.positionName = e.positionName; //寄存位置
          this.ruleForm.depositCaseId = e.id; //格位id
          this.depositCasePrice = e.depositCasePrice;

          // //console.log(this.depositCasePrice, 777);
        }
      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
        // //console.log(this.multipleSelection);
      },
      clearSelection() {
        // //console.log(this.multipleSelection);
        if (this.title === "寄存费用新增") {
          this.$refs.multipleTable.clearSelection();
          this.dialogTableVisible = false;
        } else {
          this.dialogTableVisible = false;
        }
      },
      newExpenses(express) {
        if (express === "add") {
          this.dialogTableVisible = true;
          this.title = "寄存费用新增";
        } else {
          this.dialogTableVisible = true;
          this.title = "寄存修改";
        }
      },
      // ---------------------------------------

      // ------------时间处理相关函数------------
      Timechange(starttime) {
        if (this.ruleForm.depositTypeCode === 1) {
          //console.log("cq");
        } else if (this.ruleForm.depositTypeCode === 2) {
          //console.log("dq");
        }

        if (this.ruleForm.renewUnit === "年") {
          var date = new Date(this.ruleForm.startDate);
          var year = date.getFullYear();
          year += this.ruleForm.renewNumber;
          var month = (date.getMonth(this.ruleForm.startDate) + 1)
            .toString()
            .padStart(2, "0"); //
          var day = date
            .getDate(this.ruleForm.startDate)
            .toString()
            .padStart(2, "0"); //; // 获取日期
          this.ruleForm.endDate = year + "-" + month + "-" + day;
          //console.log(this.ruleForm.endDate, 6666);
        } else if (this.ruleForm.renewUnit === "月") {
          var date = new Date(this.ruleForm.startDate);
          var year = date.getFullYear();
          var month = date.getMonth(this.ruleForm.startDate) + 1;
          month += this.ruleForm.renewNumber;
          month = month.toString().padStart(2, "0"); //

          var day = date
            .getDate(this.ruleForm.startDate)
            .toString()
            .padStart(2, "0"); //; // 获取日期
          if (month > 12) {
            let yearNumber = parseInt(month / 12);
            year = year + yearNumber;
            month = month - (12 * yearNumber);
          }
          //console.log(year + "-" + month + "-" + day)
          this.ruleForm.endDate = year + "-" + month + "-" + day;
        }
      },
      // DepositQuantity(val) {
      //   //console.log("计算金额====》》》")
      //   //console.log(this.ruleForm.depositTypeCode)
      //   //console.log(this.depositCasePrice)
      //   if (this.ruleForm.depositTypeCode === 1) {
      //     if (this.ruleForm.renewUnit === "年") {
      //       var date = new Date(this.ruleForm.startDate);
      //       var year = date.getFullYear();
      //       year += val;
      //       var month = (date.getMonth(this.ruleForm.startDate) + 1)
      //         .toString()
      //         .padStart(2, "0"); //
      //       var day = date
      //         .getDate(this.ruleForm.startDate)
      //         .toString()
      //         .padStart(2, "0"); //; // 获取日期
      //       this.ruleForm.endDate = year + "-" + month + "-" + day;
      //       this.ruleForm.itemCharge = this.ruleForm.renewNumber * this.depositCasePrice;
      //       this.ruleForm.itemCharge = this.ruleForm.itemCharge.toFixed(2);
      //     }
      //     else if (this.ruleForm.renewUnit === "月") {
      //       var date = new Date(this.ruleForm.startDate);
      //       var year = date.getFullYear();
      //       var month = date.getMonth(this.ruleForm.startDate) + 1;
      //       month += val;
      //       month = month.toString().padStart(2, "0"); //
      //       var day = date
      //         .getDate(this.ruleForm.startDate)
      //         .toString()
      //         .padStart(2, "0"); //; // 获取日期
      //       if (month > 12) {
      //         month = 0;
      //         month += val;
      //         month = month.toString().padStart(2, "0"); //
      //         year = date.getFullYear(this.ruleForm.startDate) + 1;
      //         // this.ruleForm.endDate = year + "-" + month + "-" + day;
      //       }
      //       this.ruleForm.endDate = year + "-" + month + "-" + day;
      //       this.ruleForm.itemCharge =
      //         this.ruleForm.renewNumber * (this.depositCasePrice / 12);
      //       this.ruleForm.itemCharge = this.ruleForm.itemCharge.toFixed(2);
      //     }
      //   }
      //   else if (this.ruleForm.depositTypeCode === 2) {
      //     if (this.ruleForm.renewUnit === "年") {
      //       var date = new Date(this.ruleForm.startDate);
      //       var year = date.getFullYear();
      //       year += val;
      //       var month = (date.getMonth(this.ruleForm.startDate) + 1)
      //         .toString()
      //         .padStart(2, "0"); //
      //       var day = date
      //         .getDate(this.ruleForm.startDate)
      //         .toString()
      //         .padStart(2, "0"); //; // 获取日期
      //       this.ruleForm.endDate = year + "-" + month + "-" + day;
      //
      //       this.ruleForm.itemCharge = this.ruleForm.renewNumber * (5 * 12);
      //
      //       this.ruleForm.itemCharge = this.ruleForm.itemCharge.toFixed(2);
      //     }
      //     else if (this.ruleForm.renewUnit === "月") {
      //       var date = new Date(this.ruleForm.startDate);
      //       var year = date.getFullYear();
      //       var month = date.getMonth(this.ruleForm.startDate) + 1;
      //       month += val;
      //       month = month.toString().padStart(2, "0"); //
      //       var day = date
      //         .getDate(this.ruleForm.startDate)
      //         .toString()
      //         .padStart(2, "0"); //; // 获取日期
      //       if (month > 12) {
      //         month = 0;
      //         month += val;
      //         month = month.toString().padStart(2, "0"); //
      //         year = date.getFullYear(this.ruleForm.startDate) + 1;
      //         // this.ruleForm.endDate = year + "-" + month + "-" + day;
      //       }
      //       this.ruleForm.endDate = year + "-" + month + "-" + day;
      //       this.ruleForm.itemCharge = this.ruleForm.renewNumber * 5;
      //       this.ruleForm.itemCharge = this.ruleForm.itemCharge.toFixed(2);
      //     }
      //   }
      // },
      //11.17修改计算方法
      DepositQuantity(val) {
        //console.log("计算金额====》》》")
        let depositTypeCode = this.ruleForm.depositTypeCode;
        let renewNumber = this.ruleForm.renewNumber;
        let date = new Date(this.ruleForm.startDate);
        let year = date.getFullYear();
        let month = date.getMonth(this.ruleForm.startDate) + 1;
        let day = date.getDate(this.ruleForm.startDate).toString().padStart(2, "0"); //; // 获取日期
        let itemCharge = 0;

        if (this.ruleForm.renewUnit === "年") { //寄存单位为年的
          year += val;
          month = month.toString().padStart(2, "0"); //
          if (depositTypeCode === 1) {
            itemCharge = (renewNumber * this.depositCasePrice).toFixed(2);
          } else if (depositTypeCode === 2) {
            itemCharge = (renewNumber * (5 * 12)).toFixed(2);
          }
        } else if (this.ruleForm.renewUnit === "月") { //寄存单位为月的
          month += val;
          month = month.toString().padStart(2, "0"); //
          if (month > 12) {
            let yearNumber = parseInt(month / 12);
            year = year + yearNumber;
            month = month - (12 * yearNumber);
          }
          if (depositTypeCode === 1) {  //根据寄存格位来计算金额
            itemCharge = (renewNumber * (this.depositCasePrice / 12)).toFixed(2);
          } else if (depositTypeCode === 2) {
            itemCharge = (renewNumber * 5).toFixed(2);
          }
        }
        this.ruleForm.endDate = year + "-" + month + "-" + day;
        this.ruleForm.itemCharge = itemCharge;
      },
      // ------------------------------------------
      DepositType(val) {
        if (val === 1) {
          this.ruleForm.renewUnit = "年";
        } else if (val === 2) {
          this.ruleForm.renewUnit = "月";
        }
      },
      age(type) {
        let nametype;
        if (this.copydictionary.age_type && this.copydictionary.age_type.length) {
          this.copydictionary.age_type.forEach((item) => {
            if (item.dataCode == type) {
              nametype = item.dataText;
            }
          });
          this.ruleForm.funeralDead.deadAge = "";
          if (nametype == "未知") {
            this.ruleForm.funeralDead.deadAge = "未知";
          }
        }
      },
      //年龄变化触发死亡日期变化

      //年龄限制
      agelimit(age, index) {
        let pattern = new RegExp("[0-9]+");
        if (!pattern.test(age)) {
          this.$message("请输入数字");
          this.ruleForm.funeralDead.deadAge = "";
          return;
        }
        var nametype;
        this.copydictionary.age_type.forEach((item) => {
          if (item.dataCode == this.agetype) {
            nametype = item.dataText;
          }
        });
        if (nametype == "年" && age > 200) {
          this.$message("超出范围");
          this.ruleForm.funeralDead.deadAge = 200;
          return;
        }
        //月为单位
        if (nametype == "月") {
          if (age > 12) {
            //console.log(index >= 0);
            if (index && index >= 0) {
              this.ruleForm.depositDeadItems[index].deadAge = 12;
            } else {
              this.ruleForm.familyAge = 12;
            }

            // this.ruleForm.funeralDead.deadAge = 12;
          } else if (age < 1) {
            if (index && index >= 0) {
              this.ruleForm.depositDeadItems[index].deadAge = 1;
            } else {
              this.ruleForm.familyAge = 1;
            }

            // this.ruleForm.funeralDead.deadAge = 1;
          }
        }
      },

      //去掉左右空格
      trim(str) {
        if (str == null) {
          return "";
        }
        return str.replace(/^\s*(.*?)[\s\n]*$/g, "$1");
      },

      //数据读取
      ReadData() {
        let this_read = this;
        let postData = {
          businessCode: this_read.ruleForm.businessCode,
        };
        this.loading = true;

        Type["LoadDepositRegisterWithBusiness"](postData)
          .then((response) => {
            const {data} = response;
            if (!data) {
              this.loading = false;
              this_read.$message(response.message);
              return;
            }
            //console.log(data, 3333333);
            if (data.depositDeadItems != null && data.depositDeadItems.length) {
              data.depositDeadItems.forEach((item) => {
                if (item.asHasAsh) {
                  item.asHasAsh = true;
                } else {
                  item.asHasAsh = false;
                }
              });
            }

            this.ruleForm = data;

            //console.log(this.ruleForm, 888888888);
            this_read.$store
              .dispatch("user/setbusinessCode", this_read.ruleForm.businessCode)
              .catch(() => console.log("promise catch err"));
            this_read.modify = false;

            this.loading = false;
          })
          .catch((error) => {
            // this.$message(error);
            this.loading = false;
          });

        this.getList();
      },
      getList() {
        Type["loadDepositCharges"]({
          businessCode: this.ruleForm.businessCode,
        }).then((response) => {
          const {data} = response;
          if (!data) {
            this.loading = false;
            this.$message("数据读取失败");
            return;
          }

          data.depositRenewItems.forEach((item) => {
            if (item.asSettled) {
              item.asSettled = "已结算";
            } else {
              item.asSettled = "未结算";
            }
          });
          this.tableData = data.depositRenewItems;
          this.chargeItems = data.chargeItems;
        });
      },
      searchData() {
        if (!this.ruleForm.businessCode) {
          this.$message("请输入业务编码");
          return;
        }
        //去除左右空格
        this.ruleForm.businessCode = this.trim(this.ruleForm.businessCode);
        this.ReadData();
      },
      //新增逝者火化档案
      AddInfo() {
        this.ruleForm = {
          businessCode: "",
          //寄存位置
          depositTypeCode: 1, //寄存类型code
          depositType: "", //寄存类型
          positionName: "", //寄存位置
          remark: "", //备注
          depositCaseId: "", //寄存格位id
          //寄存联系人
          familyName: "",
          certificateType: "",
          certificateNo: "",
          familyGenderCode: "",
          familyAge: "",
          familyPhone: "",
          familyAddress: "",
          DepositLocation: {},
          DepositContact: {},
          //寄存骨灰信息
          depositDeadItems: [
            {
              id: 0,
              businessCode: "",
              deadName: "",
              deadGender: "",
              deadAge: "",
              familyRelation: "",
              deadContent: "",
              asHasAsh: false,
              deadStorageTime: "",
              certificateType: "",
              certificateNo: "",
              depositStateCode: "",
              depositState: "",
              version: "",
            },
          ],
          //寄存信息
          startDate: "",
          endDate: "",
          renewUnit: "年",
          renewNumber: 0,
          itemCharge: 0,
        };

        this.businessCode = "";
        this.$store.dispatch("user/setbusinessCode", this.businessCode)
          .catch(() => console.log("promise catch err"));

        this.tableData = [];
        this.chargeItems = [];
      },

      //逝者信息保存方法
      Save(route) {
        //验证非空
        if (Date.now() - this.onpresscTime > 2000) {
          this.onpresscTime = Date.now();
          //console.log(Date.now());
        } else {
          return;
        }
        //表单验证
        this.$refs["homeRuleForm"].validate((valid) => {
          if (valid) {
            this.saveFlag = true;
            this.ruleForm.depositDeadItems.forEach((item) => {
              item.deadStorageTime = this.formatDate(item.deadStorageTime);

              if (item.asHasAsh) {
                item.asHasAsh = 1;
              } else {
                item.asHasAsh = 0;
              }
            });

            this.ruleForm.startDate = this.formatDate(this.ruleForm.startDate);
            this.ruleForm.endDate = this.formatDate(this.ruleForm.endDate);

            Type["saveDepositBusiness"](this.ruleForm)
              .then((response) => {
                const {data} = response;
                //console.log(response);
                if (!data) {
                  this.saveFlag = false;
                  this.$message("保存数据失败");
                  return;
                }
                this.saveFlag = false;
                this.$message("保存数据成功");
                this.getList();
                this.ruleForm.depositDeadItems.forEach((item) => {
                  if (item.asHasAsh) {
                    item.asHasAsh = true;
                  } else {
                    item.asHasAsh = false;
                  }
                });
              })
              .catch((error) => {
                this.$message(error);
                this.saveFlag = false;
              });
          }
        });
      },
      SaveAndService() {
        this.Save("service");
      },
      PhotoArchival() {
        this.$router.push("PhotoArchival");
      }, //打印逝者二维码
      //禁用行政区划

      //加载街道信息
      loadstreet() {
        if (!this.ruleForm.funeralDead.provinceId) {
          return;
        }
        let postData = {
          id: this.ruleForm.funeralDead.provinceId,
        };
        Type["loadstreetwithparentid"](postData)
          .then((response) => {
            const {data} = response;
            if (!data) {
              this.$message("加载数据失败");
              return;
            }
            this.streetlist = data;
            this.$set(this.streetlist, data);
          })
          .catch((error) => {
            this.$message(error);
          });
        return this.streetlist;
      },
      //加载村信息
      loadvillage(val) {
        let this_load = this;
        if (!this_load.ruleForm.funeralDead.townId) {
          return;
        }
        let postData = {
          id: this_load.ruleForm.funeralDead.townId,
        };
        //清空选择村的数据
        if (!val) {
          this_load.ruleForm.funeralDead.villageId = null;
        }
        Type["loadvillagewithparentid"](postData)
          .then((response) => {
            const {data} = response;
            if (!data) {
              this_load.$message("加载数据失败");
              return;
            }
            this_load.villagelist = data;
            this_load.$nextTick(() => {
              if (val) {
                this_load.ruleForm.funeralDead.villageId = val;
              }
            });
          })
          .catch((error) => {
            this_load.$message(error);
          });
      }, //加载街道
      Change() {
        this.$forceUpdate();
      },
      modifychange() {
        //点击修改
        this.modify = !this.modify;
        //加载省市区县
      },
      clear() {
        this.copydictionary = JSON.parse(JSON.stringify(this.dictionary));
      },
      focus() {
        this.copydictionary = JSON.parse(JSON.stringify(this.dictionary));
      },
      deathFocus() {
        this.copydictionary = JSON.parse(JSON.stringify(this.dictionary));
      }, //读取卡中的性别选择下拉
      selectChange() {
        //给业务编码设置焦点
        this.$refs.deathChange_ref.blur();
        this.$refs.homebusinessCode.focus();
      },
      //拼音检索开始
      PinyinMatchsex(val) {
        if (val) {
          let result = [];
          this.dictionary.sex.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.sex = result;
          });
        } else {
          this.copydictionary.sex = JSON.parse(
            JSON.stringify(this.dictionary.sex)
          );
        }
      },
      PinyinMatchcertificates(val) {
        if (val) {
          let result = [];
          this.dictionary.certificates.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.certificates = result;
          });
        } else {
          this.copydictionary.certificates = JSON.parse(
            JSON.stringify(this.dictionary.certificates)
          );
        }
      },
      PinyinMatchnationality(val) {
        if (val) {
          let result = [];
          this.dictionary.nationality.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.nationality = result;
          });
        } else {
          this.copydictionary.nationality = JSON.parse(
            JSON.stringify(this.dictionary.nationality)
          );
        }
      },
      //拼音或中文检索
      PinyinMatchnation(val) {
        if (val) {
          let result = [];
          this.dictionary.nation.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            } else if (item.dataText && item.dataText.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.nation = result;
          });
        } else {
          this.copydictionary.nation = JSON.parse(
            JSON.stringify(this.dictionary.nation)
          );
        }
      },
      PinyinMatchcause_of_death(val) {
        if (val) {
          let result = [];
          this.dictionary.cause_of_death.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.cause_of_death = result;
          });
        } else {
          this.copydictionary.cause_of_death = JSON.parse(
            JSON.stringify(this.dictionary.cause_of_death)
          );
        }
      },
      PinyinMatchremains_state(val) {
        if (val) {
          let result = [];
          this.dictionary.remains_state.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.remains_state = result;
          });
        } else {
          this.copydictionary.remains_state = JSON.parse(
            JSON.stringify(this.dictionary.remains_state)
          );
        }
      },
      PinyinMatchexemption_type(val) {
        if (val) {
          let result = [];
          this.dictionary.exemption_type.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.exemption_type = result;
          });
        } else {
          this.copydictionary.exemption_type = JSON.parse(
            JSON.stringify(this.dictionary.exemption_type)
          );
        }
      },
      PinyinMatchcremation_type(val) {
        if (val) {
          let result = [];
          this.dictionary.cremation_type.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.cremation_type = result;
          });
        } else {
          this.copydictionary.cremation_type = JSON.parse(
            JSON.stringify(this.dictionary.cremation_type)
          );
        }
      },
      PinyinMatchtreatment_of_ashes(val) {
        if (val) {
          let result = [];
          this.dictionary.treatment_of_ashes.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.treatment_of_ashes = result;
          });
        } else {
          this.copydictionary.treatment_of_ashes = JSON.parse(
            JSON.stringify(this.dictionary.treatment_of_ashes)
          );
        }
      },
      PinyinMatchhuimin_region(val) {
        if (val) {
          let result = [];
          this.dictionary.huimin_region.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.huimin_region = result;
          });
        } else {
          this.copydictionary.huimin_region = JSON.parse(
            JSON.stringify(this.dictionary.huimin_region)
          );
        }
      },
      PinyinMatchnegotiator_user(val) {
        if (val) {
          let result = [];
          this.dictionary.negotiator_user.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.negotiator_user = result;
          });
        } else {
          this.copydictionary.negotiator_user = JSON.parse(
            JSON.stringify(this.dictionary.negotiator_user)
          );
        }
      },
      PinyinMatchagent_type(val) {
        if (val) {
          let result = [];
          this.dictionary.agent_type.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.agent_type = result;
          });
        } else {
          this.copydictionary.agent_type = JSON.parse(
            JSON.stringify(this.dictionary.agent_type)
          );
        }
      },
      PinyinMatchrelationship_with_deceased(val) {
        if (val) {
          let result = [];
          this.dictionary.relationship_with_deceased.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.relationship_with_deceased = result;
          });
        } else {
          this.copydictionary.relationship_with_deceased = JSON.parse(
            JSON.stringify(this.dictionary.relationship_with_deceased)
          );
        }
      },
      //拼音检索结束
      //根据文本返回字典code值
      CodeInString(search_str, searchArry) {
        if (search_str && searchArry.length > 0) {
          searchArry.forEach((item) => {
            if (item.dataText.indexOf(search_str) > -1) {
              return item.dataCode;
            }
          });
        }
      },
      // 逝者身份证读取
      readDeadIdCard(type) {
        //let res=GPY_S620A3XR.idCard.readIdCard();

        let res = IdCard.idCard.load("idCardContainer").readIdCard();
        //console.log("滚滚滚",res)
        //性别 男或女
        let sexData = this.copydictionary.sex;
        let readSexData;
        if (sexData.length > 0) {
          let sexItem = null;
          let readSex = res && res.sex;
          for (let i = 0; i < sexData.length; i++) {
            sexItem = sexData[i];
            if (readSex == sexItem.dataText) {
              readSexData = sexItem.dataCode;
              break;
            }
          }
        }
        //居民身份证类型
        let certificateTypeData = this.copydictionary.certificates;
        let readCertificateData;
        if (certificateTypeData.length > 0) {
          let certItem = null;
          let readCertificate = "内地居民身份证";
          for (let i = 0; i < sexData.length; i++) {
            certItem = certificateTypeData[i];
            if (readCertificate == certItem.dataText) {
              readCertificateData = certItem.dataCode;
              break;
            }
          }
        }
        //国籍
        let countryData = this.copydictionary.nationality;
        let readCountryData;
        if (countryData.length > 0) {
          let countryItem = null;
          let readCountry = "中国";
          for (let i = 0; i < countryData.length; i++) {
            countryItem = countryData[i];
            if (readCountry == countryItem.dataText) {
              readCountryData = countryItem.dataCode;
              break;
            }
          }
        }

        if (type == "funeralDead") {
          // 姓名
          this.ruleForm.funeralDead.deadName = res && res.name;
          // 性别 读取男或女
          //给选择框赋值
          this.ruleForm.funeralDead.deadGenderCode = readSexData;
          // 逝者民族
          let nationData = this.copydictionary.nation;
          if (nationData.length > 0) {
            let nationItem = null;
            let readNation = res && res.nation;
            readNation += "族";
            for (let i = 0; i < nationData.length; i++) {
              nationItem = nationData[i];
              if (readNation == nationItem.dataText) {
                let selNationData = nationItem.dataCode;
                //给选择框赋值
                this.ruleForm.funeralDead.deadNationCode = selNationData;
                break;
              }
            }
          }
          // 出生日期
          this.ruleForm.funeralDead.birthDate = res && res.birthDate;
          // 逝者国籍，默认中国
          this.ruleForm.funeralDead.contryId = readCountryData;
          // 逝者证件类型和证件号码
          this.ruleForm.funeralDead.certificateTypeCode = readCertificateData; // 证件类型，默认身份证
          this.ruleForm.funeralDead.certificateNo = res && res.idCardNo; // 证件号码
          // 逝者户籍地
          this.ruleForm.funeralDead.householdRegistrationPlace =
            res && res.address;
          // 姓名
          this.ruleForm.funeralDead.deadName = res && res.name;
          // 出生日期
          this.ruleForm.funeralDead.birthDate = res && res.birthDate;
          // 逝者国籍，默认中国
          //this.ruleForm.funeralDead.countyId=this.CodeInString("中国",this.copydictionary.nationality)
          this.ruleForm.funeralDead.countyId = readCountryData;
          // 逝者证件类型和证件号码
          this.ruleForm.funeralDead.certificateTypeCode = readCertificateData; // 证件类型，默认身份证
          this.ruleForm.funeralDead.certificateNo = res && res.idCardNo; // 证件号码
          // 逝者户籍地
          this.ruleForm.funeralDead.householdRegistrationPlace =
            res && res.address;
        }
      },
      search(index) {
        //console.log(index);
        Type["loadDeadInfoByCode"]({
          businessCode: this.ruleForm.depositDeadItems[index].businessCode,
        }).then((response) => {
          const {data} = response;
          if (!data) {
            this_load.$message("加载数据失败");
            return;
          }
          this.ruleForm.depositDeadItems[index].deadName = data.deadName;
          this.ruleForm.depositDeadItems[index].certificateTypeCode =
            data.certificateTypeCode;
          this.ruleForm.depositDeadItems[index].certificateNo =
            data.certificateNo;

          this.ruleForm.depositDeadItems[index].deadGenderCode =
            data.deadGenderCode;
          this.ruleForm.depositDeadItems[index].deadAge = data.deadAge;
          this.ruleForm.depositDeadItems[index].familyRelation =
            data.familyRelation;
          this.ruleForm.depositDeadItems[index].deadContent = data.deadContent;
          this.ruleForm.depositDeadItems[index].deadStorageTime =
            data.deadStorageTime;
          this.ruleForm.depositDeadItems[index].asHasAsh =
            data.asHasAsh === 1 ? true : false;
          // this.ruleForm.depositDeadItems.reverse().reverse();

        });
      },
      formatDate(value) {
        if (!value) return;
        let date = new Date(value);
        let y = date.getFullYear();
        let MM = date.getMonth() + 1;
        MM = MM < 10 ? "0" + MM : MM;
        let d = date.getDate();
        d = d < 10 ? "0" + d : d;
        let h = date.getHours();
        h = h < 10 ? "0" + h : h;
        let m = date.getMinutes();
        m = m < 10 ? "0" + m : m;
        return y + "-" + MM + "-" + d;
      },
      switchChange(data) {

        this.ruleForm.depositDeadItems[data.index].asHasAsh = data.asHasAsh;
      }
    },
    watch: {
      dictionary() {
        let dicData = this.dictionary;
        this.dictionary = dicData;
        this.copydictionary = JSON.parse(JSON.stringify(dicData));
      },
      businessCodeParam() {
        if (this.businessCodeParam) {
          this.searchData();
        }
      },

      // ruleForm: {
      //   handler(newValue, oldValue) {
      //     //console.log(newValue);
      //   },
      //   deep: true,
      // },
    },
  };
</script>
<style>
  /*.cascader .el-form-item__label{*/
  /*width: 9vw!important;*/
  /*}*/
  .cascader .el-input,
  .cascader .select .el-input {
    width: 25.6vw !important;
    min-width: 40px;
  }

  .lineheight label {
    line-height: 20px !important;
    letter-spacing: 3px;
  }

  .streetwidth,
  .streetwidth input,
  .streetwidth .el-input,
  .streetwidth .el-select {
    width: 7vw !important;
    min-width: 120px !important;
  }

  .agewidth,
  .agewidth input,
  .agewidth .el-input {
    width: 5vw !important;
    min-width: 90px !important;
    overflow: hidden;
  }

  .input-with-select .el-input-group__prepend {
    background-color: #fff;
  }

  .PageContent .zm .el-input,
  .PageContent .zm .el-select {
    width: 25.6vw;
    min-width: 40px;
  }

  .marginbottom0 .el-form-item {
    margin-bottom: 0px;
  }

  .home .el-textarea__inner {
    line-height: 2;
    min-height: 70px !important;
  }

  .home .el-select .el-input__inner {
    cursor: pointer;
    padding-right: 2px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
</style>
<style scoped>
  .home {
    color: #606266;
  }

  .w1230 {
    width: 72.5vw !important;
    min-width: 40px !important;
  }

  .w425 {
    width: 25.6vw;
    min-width: 40px;
  }

  .w50 {
    width: 57vw;
    min-width: 40px;
  }

  .letter2 {
    letter-spacing: 5px;
  }

  .switch-wrap {

  }
</style>
